<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  /* 
    函数内容返回函数时，使用了该变量(该变量并不会被回收)，那么就会形成了闭包。
  */
  "use strict"; {
    const aa = () => {
      let i = 1;
      return () => {
        let j = 0;
        (() => {
          ++j;
          console.log(j);
        })();
      }
    }
    let bb = aa();
    bb();
    bb();
    bb();
  };
</script>

</html>